#!/usr/bin/env python

import sys
import codecs
import StringIO
from mwlib import uparser, htmlwriter

def convert(name, HTML):
    out = sys.stdout 
    out.write("weeee")
    a = uparser.parseString(name, raw=HTML)    
    w = htmlwriter.HTMLWriter(out)
    w.write(a)
    return 0

def main(infile):
    print(convert(infile, codecs.open(infile, 'r', 'utf-8').read()))
    return 0

if __name__ == "__main__":
    sys.exit(main(sys.argv[1]))
